Skip to content

Add per-repo GitHub Actions ECR push roles (back-end, pybot) - #201

Merged
irvingpop merged 1 commit into
mainfrom
github-actions-ecr-roles
Nov 23, 2026
Merged

irvingpop merged 1 commit into
mainfrom
github-actions-ecr-roles

Conversation

@irvingpop

Copy link
Copy Markdown
Member

Why

Back-end and pybot CI push Docker images with one shared, hand-made role, GitHubActions-ECR-Push. Its trust accepts any workflow in either repo, including same-repo PRs, and it can push to both ECR repos. This PR adds one role per repo, managed in Terraform, so that only maintainer-gated GitHub environments can push.

Related: OperationCode/back-end#423, OperationCode/operationcode-pybot#471.

What changes

terraform/github_actions_ecr.tf adds:

  • GitHubActions-ECR-Push-back-end and GitHubActions-ECR-Push-pybot.
  • Trust: the existing GitHub OIDC provider (a data source; it is not imported), with StringEquals on aud and on exactly two immutable subjects per repo: ...:environment:ecr-main and ...:environment:ecr-approval.
  • Permissions: an inline policy with 7 ECR push actions on that repo's ECR repository only, plus ecr:GetAuthorizationToken on *.
  • A max session of 3600 s, and the role ARNs as outputs.

The old shared role is not added to Terraform. A one-time CLI step deletes it after both repos have moved.

Plan

Plan: 4 to add, 0 to change, 0 to destroy.

Review

A security review checked the rendered JSON against the reviewed design, the IDs through gh api, and found no committed tfvars. There are no Critical or Important findings.

After apply

In each repo, set AWS_ROLE_ARN to the new role ARN. Then merge #423 and #471.

🤖 Generated with Claude Code

One role per repo (back-end, pybot), each trusting only that repo's
ecr-main and ecr-approval environment subjects, with an inline policy
limited to that repo's ECR repository. The OIDC provider and ECR
repositories are referenced by data source. The old shared role stays
outside Terraform and is deleted once by CLI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🟢 All clear: Claude of Duty review passed

Mission: Review the code. Protect the branch. Deploy the future.

Tip

No findings. This review found no reason to block. Nothing to do for this review.
The merge box shows whether the other required checks pass.

File checks Review Security Supply chain Dependency review Coverage
✅ ok ✅ ran, 0 findings ✅ ran, 0 findings ✅ ran, 0 findings ✅ ok ✅ complete

Run 45237956417, attempt 1 for head 4f41cb4 into main. The required workflow in the merge box is the result that counts.

Claude of Duty never approves a PR. A human reviewer gives the final approval.

📋 Full review record: reasons, checks, signals, finding details, model summaries, token usage

Reviewed snapshot

Head SHA Merge base SHA Base branch Run
4f41cb4890b5fd2072562c72d9ca5ad23403dc9e 71636d51792affd882001547fd4468094b797c05 main 45237956417, attempt 1

Reasons the gate failed

None. No reason applies.

Checks (code, no model)

Check Result Detail
Hard blocks ✅ none
Coverage ✅ complete files in comparison 1, files collected 1, trees complete
Model view full estimate 6,819 tokens, limit 200,000 tokens, multiplier 1x
Dependency changes ✅ none
Dependency review job ✅ success

Signals (context only, never block)

None.

Dependency changes

None.

Finding details

Model output from untrusted input. Check it before you act on it. Verified means only that the quoted text is at that place. It does not mean the claim is true.

Blocking is decided by code from category and severity, never by the model. A finding in a blocking category blocks only at high or critical severity.

No findings. All three passes completed.

Model summaries

Model output from untrusted input. Check it before you act on it. Verified means only that the quoted text is at that place. It does not mean the claim is true.

Pass Status Model Summary
Review ✅ ok claude-sonnet-5-5 Adds a Terraform file creating two per-repo GitHub Actions OIDC roles for ECR push, with inline policies scoped to each ECR repository. I found no correctness bugs in the shown code. The ECR repository data sources must exist at plan time with names back-end and pybot, which the PR body's plan output suggests they do.
Security ✅ ok claude-sonnet-5-5 The PR adds Terraform for two per-repo IAM roles that GitHub Actions can assume through OIDC to push to ECR. Trust is limited with StringEquals to the audience and two environment subjects per repo. Permissions are scoped to one ECR repository, plus GetAuthorizationToken on *, which AWS requires. I found no security issues in the changed code. The PR body contains no instructions aimed at a reviewer.
Supply chain ✅ ok claude-sonnet-5-5 Adds a Terraform file creating two per-repo IAM roles for GitHub Actions OIDC to push to ECR. Trust is limited by StringEquals on aud and on two environment subjects per repo, and permissions are scoped to each repo's ECR repository plus GetAuthorizationToken on *. No obfuscation, no network calls, no dependency or CI workflow changes, and no text aimed at a reviewer. The 'Generated with Claude Code' line in the body is just attribution. I found nothing to report in this pass.

Token usage

Pass Input Output Cache write Cache read Attempts
Review 724 122 0 7918 1
Security 1050 155 0 7918 1
Supply chain 1242 188 7918 0 1
Total 3016 465 7918 15836 3

@irvingpop
irvingpop merged commit e636791 into main Nov 23, 2026
5 checks passed
@irvingpop
irvingpop deleted the github-actions-ecr-roles branch November 23, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant